/**
 * Selling Partner API for Easy Ship
 * Use the Selling Partner API for Easy Ship to build applications for sellers to manage and ship Amazon Easy Ship orders. With this API, you can get available time slots, schedule and reschedule Easy Ship orders, and print shipping labels, invoices, and warranties. To review the differences in Easy Ship operations by marketplace, refer to [Marketplace support](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support).
 *
 * The version of the OpenAPI document: 2022-03-23
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 *
 */

import { ApiClient } from '../ApiClient.js'
import { Item } from './Item.js'
import { TimeSlot } from './TimeSlot.js'

/**
 * The PackageDetails model module.
 * @module easyship_v2022_03_23/model/PackageDetails
 * @version 2022-03-23
 */
export class PackageDetails {
  /**
   * Constructs a new <code>PackageDetails</code>.
   * Package details. Includes &#x60;packageItems&#x60;, &#x60;packageTimeSlot&#x60;, and &#x60;packageIdentifier&#x60;.
   * @alias module:easyship_v2022_03_23/model/PackageDetails
   * @class
   * @param packageTimeSlot {TimeSlot}
   */
  constructor (packageTimeSlot) {
    this.packageTimeSlot = packageTimeSlot
  }

  /**
   * Constructs a <code>PackageDetails</code> from a plain JavaScript object, optionally creating a new instance.
   * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
   * @param {Object} data The plain JavaScript object bearing properties of interest.
   * @param {PackageDetails} obj Optional instance to populate.
   * @return {PackageDetails} The populated <code>PackageDetails</code> instance.
   */
  static constructFromObject (data, obj) {
    if (data) {
      switch (typeof data) {
        case 'string':
          obj = String(data)
          break
        case 'number':
          obj = Number(data)
          break
        case 'boolean':
          obj = Boolean(data)
          break
      }
      obj = obj || new PackageDetails()
      if (data.hasOwnProperty('packageItems')) { obj.packageItems = ApiClient.convertToType(data.packageItems, [Item]) }
      if (data.hasOwnProperty('packageTimeSlot')) { obj.packageTimeSlot = TimeSlot.constructFromObject(data.packageTimeSlot) }
      if (data.hasOwnProperty('packageIdentifier')) { obj.packageIdentifier = ApiClient.convertToType(data.packageIdentifier, 'String') }
    }
    return obj
  }
}

/**
 * A list of items contained in the package.
 * @member {[Item]} packageItems
 * @type {[Item]}
 */
PackageDetails.prototype.packageItems = undefined

/**
 * @member {TimeSlot} packageTimeSlot
 * @type {TimeSlot}
 */
PackageDetails.prototype.packageTimeSlot = undefined

/**
 * Optional seller-created identifier that is printed on the shipping label to help the seller identify the package.
 * @member {String} packageIdentifier
 * @type {String}
 */
PackageDetails.prototype.packageIdentifier = undefined
